from PyQt5.QtCore import *
#信号对象
class QtypeSignal(QObject):
    #定义信号
    sendmsg=pyqtSignal(str,str)
    def __init__(self):
        super(QtypeSignal,self).__init__()
    def run(self):
        #发射信号
        self.sendmsg.emit('参数1','参数2')
#槽对象
class QtypeSina(QObject):
    def __init__(self):
        super(QtypeSina,self).__init__()
    #槽函数
    def get(self,msg1,msg2):
        print("get msg"+msg1+''+msg2)
if __name__ == '__main__':
    send=QtypeSignal()
    slot=QtypeSina()
    #信号绑定到槽
    send.sendmsg.connect(slot.get)
    send.run()
    #信号和槽断开
    send.sendmsg.disconnect(slot.get)
    send.run()

